﻿<UserControl x:Class="SurfaceApplication3.map"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:my="http://schemas.microsoft.com/surface/2008"
             xmlns:dz="clr-namespace:DeepZoom.Controls;assembly=DeepZoom"
             mc:Ignorable="d" 
             d:DesignHeight="640" d:DesignWidth="854" x:Name="background" Background="#B0CAB8">
    
    <UserControl.Resources>
        <Style TargetType="{x:Type my:SurfaceRadioButton}" x:Key="style1" >
             <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:SurfaceRadioButton}">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Canvas Width="17" Height="17">
                                    <Ellipse Fill="White" Width="17" Height="17"/>
                                    <Ellipse Fill="Red" Width="15" Height="15" Canvas.Left="1" Canvas.Top="1"/>
                                    <Ellipse x:Name="checked" Fill="Purple" Width="12" Height="12" Canvas.Left="2.5" Canvas.Top="2.5" /> 
                                    <ContentPresenter Canvas.Left="40"/>
                                </Canvas>
                            </BulletDecorator.Bullet>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="checked" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type my:SurfaceRadioButton}" x:Key="style2" >
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:SurfaceRadioButton}">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Canvas Width="180" Height="48">
                                    <Ellipse Fill="White" Width="17" Height="17"/>
                                    <Ellipse Fill="Blue" Width="15" Height="15" Canvas.Left="1" Canvas.Top="1"/>
                                    <Ellipse x:Name="checked" Fill="Purple" Width="12" Height="12" Canvas.Left="2.5" Canvas.Top="2.5" />
                                    <ContentPresenter Canvas.Left="40"/>
                                </Canvas>
                            </BulletDecorator.Bullet>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="checked" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type my:SurfaceRadioButton}" x:Key="style3" >
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:SurfaceRadioButton}">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Canvas Width="180" Height="48">
                                    <Ellipse Fill="White" Width="17" Height="17"/>
                                    <Ellipse Fill="Yellow" Width="15" Height="15" Canvas.Left="1" Canvas.Top="1"/>
                                    <Ellipse x:Name="checked" Fill="Purple" Width="12" Height="12" Canvas.Left="2.5" Canvas.Top="2.5" />
                                    <ContentPresenter Canvas.Left="40"/>
                                </Canvas>
                            </BulletDecorator.Bullet>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="checked" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="my:SurfaceButton">
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="#227174"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="my:SurfaceButton">

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" >
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                                            <GradientStop Color="#FF90DDFF" Offset="0.35"/>
                                            <GradientStop Color="LightBlue" Offset="0.95"/>
                                            <GradientStop Color="#FF81DDFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" >
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                                        <GradientStop Color="DarkGray" Offset="0.35"/>

                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            </Trigger>
                       
                        </ControlTemplate.Triggers>
                        <Border CornerRadius="7" Margin="0" Background="{TemplateBinding Background}" BorderBrush="#227174" BorderThickness="2">
                            <ContentPresenter 
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                >
                            </ContentPresenter>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>


    <Grid >
        <Canvas>
            <Label Content="Select the type of marker by clicking one of the circles." Canvas.Left="19" FontSize="16" Foreground="Black" Width="481" Canvas.Top="0" />
            <Label Content="Then select the location on the map and fill in the information below." Canvas.Left="19" FontSize="16" Canvas.Top="18" Foreground="Black"/>
            
            <dz:MultiScaleImage Name="map1" Width="768.5" Height="433.7" Canvas.Left="42" Canvas.Top="89" Canvas.ZIndex="10"/>
            <Rectangle Height="433.7"  Stroke="#227174" Width="768.5" Fill="#FFEDF5E2" StrokeThickness="3" Canvas.ZIndex="0" Canvas.Top="87" Canvas.Left="40"/>
            <Canvas x:Name="mapCover" Height="433.7" Width="768.5" Canvas.Top="87" Canvas.Left="40" Canvas.ZIndex="20" Background="Transparent" IsHitTestVisible="False">
            
            </Canvas>
            <Label Name="dateLabel" Content="Date:  From:" Canvas.Bottom="70" Canvas.Left="30" Foreground="Black" FontSize="16"/>          
            <my:SurfaceTextBox x:Name="date" Canvas.Bottom="70" Canvas.Left="128" Width="100" BorderBrush="#227174" Background="Transparent" Foreground="Black" FontSize="16" IsReadOnly="True" TextChanged="date_TextChanged" MaxLength="5" />
            <Label Content="To:" Canvas.Bottom="70" Canvas.Left="227" Foreground="Black" />
            <my:SurfaceTextBox x:Name="dateTo" Canvas.Bottom="70" Canvas.Left="260" Width="100" Foreground="Black" FontSize="16" BorderBrush="#227174" Background="Transparent" IsReadOnly="True" MaxLength="5" TextChanged="dateTo_TextChanged" />
            <Label Content="Country and city:" Canvas.Bottom="70" Canvas.Left="380" Foreground="Black" Background="Transparent"  FontSize="16"/>
            <my:SurfaceTextBox x:Name="city" Canvas.Bottom="70" Canvas.Left="550" Width="200" BorderBrush="#227174" Background="Transparent" Foreground="Black" FontSize="16" IsReadOnly="True" TextChanged="city_TextChanged" />

            <Rectangle Height="35" Name="rectangle1" Stroke="#FFEDF5E2" Width="780" Fill="#227174" StrokeThickness="3" Canvas.Top="47" Canvas.Left="27"/>
            <my:SurfaceRadioButton x:Name="red" BorderBrush="White" BorderThickness="2" Content="Point of origin" Background="Red" Canvas.Top="53" Canvas.Left="40" Checked="SurfaceRadioButton_Checked" Style="{StaticResource style1}" ToolTip="Only one point of origin will be recorded"/>
            <my:SurfaceRadioButton x:Name="blue" BorderBrush="White"  BorderThickness="2" Content="Exhibition locations" Canvas.Top="53" Background="Blue" Canvas.Left="265" Checked ="SurfaceRadioButton_Checked_1"  Style="{StaticResource style2}" Width="203" />
            <my:SurfaceButton Content="Cancel Changes" x:Name="Cancel" Height="30" Width="125"  Foreground="White" Canvas.Bottom="18" Canvas.Right="179" Click="Cancel_Click" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" MinHeight="0" MinWidth="0" FontSize="14"/>
            <my:SurfaceButton Content="Remove One" x:Name="RemoveOne" Height="30" Width="120"  Foreground="White" Canvas.Bottom="18"  Canvas.Right="316" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" MinHeight="0" MinWidth="0" FontSize="14" Click="RemoveOne_Click" />
            <my:SurfaceButton Content="Save and Close" Height="30" Foreground="White" Canvas.Bottom="18" Canvas.Right="25" Click="save_close_click" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Width="141" MinHeight="0" MinWidth="0" FontSize="14" />
            <my:SurfaceRadioButton x:Name="yellow" BorderBrush="White" BorderThickness="2" Content="Current location" Background="Yellow" Checked="SurfaceRadioButton_Checked_2" Style="{StaticResource style3}" Canvas.Left="553" Canvas.Top="53" ToolTip="Only one point of current locations will be recorded" />
            
        </Canvas>
    </Grid>
</UserControl>
